#ifndef POLYGON_H_
#define POLYGON_H_

#include "include.h"

class Polygon
{
private:
	QRectF bounding;
	QList<QPointF> vertexes;
	
	//-- FUNCIONES AUXILIARES:
	float triangleArea(QPointF, QPointF, QPointF);
	int side(QPointF, QPointF, QPointF);
	void update();
	
public:
	Polygon();
	virtual ~Polygon();
	QList<QPointF> getVertexes();
	QRectF boundingBox();
	QPointF getVertexAt(int);
	QPointF center();
	QPointF position();
	Polygon rotate(float);
	Polygon scale(int);
	Polygon translate(QPointF);
	void addVertex(QPointF);
	void addVertexes(QList<QPointF>);
	void insertVertexAt(int, QPointF);
	void removeVertex(QPointF);
	void removeVertexAt(int);
	void removeVertexes();
	void moveVertex(int, QPointF);
	void rotateMe(float);
	void scaleMe(int);
	void translateMe(QPointF);
	void reflectMe(int);
	float height();
	float width();
	float area();
	bool inside(QPointF);
	bool collision(Polygon);
	bool operator > (Polygon);	
	bool operator < (Polygon);
	bool operator == (Polygon);
	bool isEmpty();
	int count();
};

#endif /*POLYGON_H_*/
